<!--
 * @Author: cest
 * @Date: 2022-08-08 10:33:04
 * @LastEditTime: 2022-08-09 10:31:58
 * @LastEditors: cest
 * @FilePath: /nuxt3-vite/components/DarkToggle.vue
 * @Description: 编辑描述内容
-->
<script setup lang="ts">
const colorMode = useColorMode()

function toggleDark() {
  colorMode.preference = colorMode.value === 'dark' ? 'light' : 'dark'
}
</script>

<template>
  <button class="!outline-none" @click="toggleDark">
    <div class="dark:i-carbon-moon i-carbon-sun" />
  </button>
</template>
